package cn.rkylin.oms.system.shop.domain;

import cn.rkylin.oms.common.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;

/**
 * 店铺实体，对应shop表
 *
 * @author wangxiaoyi
 * @version 1.0
 * @created 13-1月-2017 09:11:15
 */
public class Shop extends BaseEntity {
    /**
     * 序列化id
     */
    private static final long serialVersionUID = 2311449459392774878L;

    /**
     * 店铺id
     */
    private String shopId;

    /**
     * 店铺名称
     */
    private String shopName;

    /**
     * 企业id
     */
    private String entId;

    /**
     * 项目id
     */
    private String prjId;
    
    /**
     * 项目
     */
    private String prjName;
    
    /**
     * 渠道id
     */
    private String channelId;
    
    /**
     * 渠道
     */
    private String channelName;

    /**
     * 店铺类型
     */
    private String shopType;

    /**
     * 店铺帐号
     */
    private String shopAccount;

    /**
     * 店铺密码
     */
    private String shopPassword;

    /**
     * 验证？
     */
    private String validate;

    /**
     * 可用？
     */
    private String enable;

    /**
     * 删除？
     */
    private String deleted;

    /**
     * 是否需要拆单
     */
    private String needSplitOrder;

    /**
     * 父店铺
     */
    private String parentShop;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    /**
     * 过期时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date expireTime;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date modifyTime;

    /**
     * 备注
     */
    private String remark;

    /**
     * 淘宝api url
     */
    private String apiUrl;

    /**
     * 淘宝appkey
     */
    private String appKey;

    /**
     * 淘宝app secret
     */
    private String appSecret;

    /**
     * 淘宝session key
     */
    private String sessionKey;

    /**
     * 淘宝会话刷新token
     */
    private String refreshToken;

    /**
     * 淘宝订单获取模式：rds,api
     */
    private String connMode;

    /**
     * 淘宝rds db url
     */
    private String dbUrl;

    /**
     * 淘宝rds db username
     */
    private String dbUsername;

    /**
     * 淘宝rds db password
     */
    private String dbPassword;

    /**
     * 允许同步库存
     */
    private String isSyncInventory;

    /**
     * 允许自动审核
     */
    private String isAutoAuthen;

    /**
     * 允许自动平台发货
     */
    private String isAutoPlatformDelivery;

    /**
     * 允许自动合并订单
     */
    private String isAutoMergeOrder;

    /**
     * 存在可合并的已审核未完成但不可操作的订单打问题单
     */
    private String hasErrorOrderR1;

    /**
     * 存在可合并但有未废弃退款单的订单(排除自身)
     */
    private String hasErrorOrderR2;

    /**
     * 存在买家留言(-----审单设置)
     */
    private String hasCustRemark;

    /**
     * 存在卖家备注(-----审单设置)
     */
    private String hasSalesRemark;

    /**
     * 订单审核校验可分派数(-----审单设置)
     */
    private String isCheckCanallotqty;

    /**
     * 收货地址超长字节数(-----审单设置)
     */
    private int orderConsAddrLen;

    /**
     * 是否自动生成退货单
     */
    private String isAutoGenerateReturn;

    /**
     * 自动售后是否开启
     */
    private String isAutoAfterSale;

    /**
     * 平台订单最后更新时间
     */
    private Date orderLastUpdateTime;

    /**
     * 平台退款单最后更新时间
     */
    private Date refundLastUpdateTime;

    public String getShopId() {
        return shopId;
    }

    public void setShopId(String shopId) {
        this.shopId = shopId == null ? null : shopId.trim();
    }

    public String getEntId() {
        return entId;
    }

    public void setEntId(String entId) {
        this.entId = entId;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName == null ? null : shopName.trim();
    }

    public String getPrjName() {
        return prjName;
    }

    public void setPrjName(String prjName) {
        this.prjName = prjName;
    }

    public String getPrjId() {
        return prjId;
    }

    public void setPrjId(String prjId) {
        this.prjId = prjId == null ? null : prjId.trim();
    }

    public String getChannelId() {
		return channelId;
	}

	public void setChannelId(String channelId) {
		this.channelId = channelId;
	}

	public String getChannelName() {
		return channelName;
	}

	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}

	public String getShopType() {
        return shopType;
    }

    public void setShopType(String shopType) {
        this.shopType = shopType == null ? null : shopType.trim();
    }

    public String getShopAccount() {
        return shopAccount;
    }

    public void setShopAccount(String shopAccount) {
        this.shopAccount = shopAccount == null ? null : shopAccount.trim();
    }

    public String getShopPassword() {
        return shopPassword;
    }

    public void setShopPassword(String shopPassword) {
        this.shopPassword = shopPassword;
    }

    public String getValidate() {
        return validate;
    }

    public void setValidate(String validate) {
        this.validate = validate == null ? null : validate.trim();
    }

    public String getEnable() {
        return enable;
    }

    public void setEnable(String enable) {
        this.enable = enable == null ? null : enable.trim();
    }

    public String getDeleted() {
        return deleted;
    }

    public String getNeedSplitOrder() {
        return needSplitOrder;
    }

    public void setNeedSplitOrder(String needSplitOrder) {
        this.needSplitOrder = needSplitOrder;
    }

    public String getParentShop() {
        return parentShop;
    }

    public void setParentShop(String parentShop) {
        this.parentShop = parentShop;
    }

    public void setDeleted(String deleted) {
        this.deleted = deleted == null ? null : deleted.trim();
    }

    public Date getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getConnMode() {
        return connMode;
    }

    public void setConnMode(String connMode) {
        this.connMode = connMode;
    }

    public String getDbUrl() {
        return dbUrl;
    }

    public void setDbUrl(String dbUrl) {
        this.dbUrl = dbUrl;
    }

    public String getDbUsername() {
        return dbUsername;
    }

    public void setDbUsername(String dbUsername) {
        this.dbUsername = dbUsername;
    }

    public String getDbPassword() {
        return dbPassword;
    }

    public void setDbPassword(String dbPassword) {
        this.dbPassword = dbPassword;
    }

    public String getApiUrl() {
        return apiUrl;
    }

    public void setApiUrl(String apiUrl) {
        this.apiUrl = apiUrl;
    }

    public String getAppKey() {
        return appKey;
    }

    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }

    public String getAppSecret() {
        return appSecret;
    }

    public void setAppSecret(String appSecret) {
        this.appSecret = appSecret;
    }

    public String getSessionKey() {
        return sessionKey;
    }

    public void setSessionKey(String sessionKey) {
        this.sessionKey = sessionKey;
    }

    public String getRefreshToken() {
        return refreshToken;
    }

    public void setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
    }

    public String getIsSyncInventory() {
        return isSyncInventory;
    }

    public void setIsSyncInventory(String isSyncInventory) {
        this.isSyncInventory = isSyncInventory;
    }

    public String getIsAutoAuthen() {
        return isAutoAuthen;
    }

    public void setIsAutoAuthen(String isAutoAuthen) {
        this.isAutoAuthen = isAutoAuthen;
    }

    public String getIsAutoPlatformDelivery() {
        return isAutoPlatformDelivery;
    }

    public void setIsAutoPlatformDelivery(String isAutoPlatformDelivery) {
        this.isAutoPlatformDelivery = isAutoPlatformDelivery;
    }

    public String getIsAutoMergeOrder() {
        return isAutoMergeOrder;
    }

    public void setIsAutoMergeOrder(String isAutoMergeOrder) {
        this.isAutoMergeOrder = isAutoMergeOrder;
    }

    public String getHasErrorOrderR1() {
        return hasErrorOrderR1;
    }

    public void setHasErrorOrderR1(String hasErrorOrderR1) {
        this.hasErrorOrderR1 = hasErrorOrderR1;
    }

    public String getHasErrorOrderR2() {
        return hasErrorOrderR2;
    }

    public void setHasErrorOrderR2(String hasErrorOrderR2) {
        this.hasErrorOrderR2 = hasErrorOrderR2;
    }

    public String getHasCustRemark() {
        return hasCustRemark;
    }

    public void setHasCustRemark(String hasCustRemark) {
        this.hasCustRemark = hasCustRemark;
    }

    public String getHasSalesRemark() {
        return hasSalesRemark;
    }

    public void setHasSalesRemark(String hasSalesRemark) {
        this.hasSalesRemark = hasSalesRemark;
    }

    public String getIsCheckCanallotqty() {
        return isCheckCanallotqty;
    }

    public void setIsCheckCanallotqty(String isCheckCanallotqty) {
        this.isCheckCanallotqty = isCheckCanallotqty;
    }

    public int getOrderConsAddrLen() {
        return orderConsAddrLen;
    }

    public void setOrderConsAddrLen(int orderConsAddrLen) {
        this.orderConsAddrLen = orderConsAddrLen;
    }

    public String getIsAutoAfterSale() {
        return isAutoAfterSale;
    }

    public void setIsAutoAfterSale(String isAutoAfterSale) {
        this.isAutoAfterSale = isAutoAfterSale;
    }

    public String getIsAutoGenerateReturn() {
        return isAutoGenerateReturn;
    }

    public void setIsAutoGenerateReturn(String isAutoGenerateReturn) {
        this.isAutoGenerateReturn = isAutoGenerateReturn;
    }

    /**
     * getOrderLastUpdateTime:店铺上保存了平台订单上次更新时间 <br/>
     * 如果没有设置此时间，则以店铺创建时间作为上次更新时间.<br/>
     *
     * @return
     * @author wangxing
     */
    public Date getOrderLastUpdateTime() {
        if (null == orderLastUpdateTime) {
            orderLastUpdateTime = createTime;
        }
        return orderLastUpdateTime;
    }

    public void setOrderLastUpdateTime(Date orderLastUpdateTime) {
        this.orderLastUpdateTime = orderLastUpdateTime;
    }

    /**
     * getSysRefundLastUpdateTime:店铺上保存了退款单上次更新时间 <br/>
     * 如果没有设置此时间，则以店铺创建时间作为上次更新时间.<br/>
     *
     * @return
     * @author zhanghao
     */
    public Date getSysRefundLastUpdateTime() {
        if (null == refundLastUpdateTime) {
            refundLastUpdateTime = createTime;
        }
        return refundLastUpdateTime;
    }

    public void setSysRefundLastUpdateTime(Date sysRefundLastUpdateTime) {
        this.refundLastUpdateTime = sysRefundLastUpdateTime;
    }

}